home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / Think Class Libraries / File class library / headers / CIsleFile.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-11-30  |  3.9 KB  |  110 lines  |  [TEXT/KAHL]

  1. /*
  2.  
  3.   CFolder.h
  4.   Superclass:    CFile
  5.  
  6.     CFile plus directory manipulation.
  7.  
  8.   October 8, 1992  isl
  9.   
  10. */
  11.  
  12. #define    _H_CIsleFile                                    //    Include this file only once
  13.  
  14. #include    <CFile.h>                                        //    Superclass definitions
  15.  
  16. #define        kRoot                    1                            //    The root directory is always ID=1 (I hope)
  17. #define        kDirectory        -1                        //    Home directory index for directories
  18. #define        kDefault            0                            //    Default specification
  19. #define        kNone                    0                            //    No data
  20. #define        kFirst                1                            //    Start at the beginning
  21. #define        kDirTest            16                        //    Test bit for a directory
  22. #define        kInvisible        16384                    //    Test bit for invisibility
  23. #define        kStationery        2048                    //    Test bit for a stationery file
  24. #define        kFlagsOff            0x00000000        //    Turn everything off
  25.  
  26. #define        kFailed                -1                        //    An operation failed
  27.  
  28. #define        kNoSignature    0                            //    No owner signature
  29. #define        kNoType                0                            //    No file type
  30. #define        kGeneric            '????'                //    Generic owner signature or type
  31.  
  32. /*=====================*/
  33. /*===---------------===*/
  34.  
  35. class CIsleFile : public CFile
  36. Begin
  37. public:
  38.     Boolean                fSuper;                                //    Are System 7 goodies available?
  39.     Boolean                fGood;                                //    Is the current information valid?
  40.  
  41. public:
  42.     void                    IIsleFile                            //    Initialize the object
  43.                             (    void
  44.                             );
  45.                             
  46.     virtual    void    CreateNew                            //    Create a file at the current level, no user query
  47.                             (    OSType            creator,        //    The file's creator
  48.                                 OSType            type                //    The file's type
  49.                             );
  50.     virtual    void    ResolveFileAlias            //    Resolve specification if an alias
  51.                             (    void                                        //    No arguments
  52.                             );
  53.     virtual    void    GetPath                                //    Provide file's path as a string of characters
  54.                             (    Str255            path,                //    The string describing the path
  55.                                 Str255            delimiter        //    The string describing path delimiters
  56.                             );
  57.     virtual    Boolean IsStationery                //    Is this file a stationery document?
  58.                             (    void                                        //    No arguments
  59.                             );
  60.     virtual    void GetMacCatInfo                    //    Get current file or folder specifications
  61.                             (    CInfoPBPtr    specs                //    The parameter block of file specifications
  62.                             );
  63.     virtual    void SetMacCatInfo                    //    Get current file or folder specifications
  64.                             (    CInfoPBPtr    specs                //    The parameter block of file specifications
  65.                             );
  66.     virtual void SetMacFileInfo                    //    Set the file information record
  67.                             ( FInfo*            fileInfo        //    The information
  68.                             );
  69.     virtual Boolean GoodType                        //    Check the file type
  70.                             ( OSType            fileType        //    The desired type
  71.                             );
  72.     virtual    void MakeStationery                    //    Get current file or folder specifications
  73.                             (    Boolean            fStatinery    //    Control toggle
  74.                             );
  75.     
  76.     virtual    void FindCreatorType                //    Find a file by its creator and type
  77.                             (    short             vRefNum,        //    The volume reference number
  78.                                 long                 directory,    //    The directory
  79.                                 OSType            creator,        //    The creator of the file
  80.                                 OSType             type,                //    The type of the file
  81.                                 Boolean            inside            //    Should I check inside sub-directories?
  82.                             );
  83.                             
  84.     virtual    OSErr MakeFSSpec                        //    Make a System7-like FSSpec record
  85.                             (    short             vRefNum,        //    The volume reference number
  86.                                 long                 directory,    //    The directory
  87.                                 StringPtr     leafName,        //    The name of the directory leaf
  88.                                 short             index,            //    The directory index
  89.                                 FSSpec*         fileSpec        //    The specification record
  90.                             );
  91.                             
  92.     virtual    void    MoveToTrash                        //    Move a file into the Trash
  93.                             (    void                                        //    No arguments
  94.                             );
  95.  
  96.     virtual    void    CreateUniqueNew                //    Create a uniquely named file
  97.                             (    OSType            creator,        //    The file's creator
  98.                                 OSType            type                //    This file's type
  99.                             );
  100.     
  101. private:
  102.     virtual    void    CollectPath                        //    Provide file's path as a string of characters
  103.                             (    Str255            path,                //    The string describing the path
  104.                                 Str255            delimiter,    //    The string describing path delimiters
  105.                                 FSSpec*            leafSpec        //    Specification of a directory level
  106.                             );
  107. End;
  108.  
  109. /*===---------------===*/
  110. /*=====================*/